{% extends 'common/_base.html' %}
{% block title %}修改密码{% endblock %}
{% block content %}
    <nav class="page-breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="/">首页</a></li>
            <li class="breadcrumb-item active" aria-current="page">修改密码</li>
        </ol>
    </nav>
    <div class="row">
        <div class="col-md-12 grid-margin stretch-card">
            <div class="card">
                <div class="card-body">

                    <h6 class="card-title">修改密码</h6>

                    {% if request.user.login_info.source == 'ding' %}
                        <div class="alert alert-warning alert-dismissible fade show" role="alert">
                            <strong>提示!</strong> 当前登录方式为 <span
                                class="badge badge-primary">钉钉扫码</span> 不能修改密码
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                    {% else %}


                        <div class="alert alert-info alert-dismissible fade show" role="alert">
                            <strong>提示!</strong> 修改当前登录方式的密码，当前登录方式为 <span
                                class="badge badge-primary">{{ request.user.login_info.source }}</span>
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>

                        {% if error %}
                            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                                <strong>错误!</strong> {{ error.message }}
                                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>

                        {% endif %}


                        <form method="post" class="forms-sample col-sm-4">
                            <div class="form-group">
                                <label>旧密码</label>
                                <input type="password" class="form-control" id="old_password" autocomplete="off"
                                       placeholder="" name="old_password">

                            </div>
                            <div class="form-group">
                                <label>新密码</label>
                                <input type="password" class="form-control" id="new_password" autocomplete="off"
                                       placeholder="" name="new_password">

                            </div>
                            <div class="form-group">
                                <label>重复一次</label>
                                <input type="password" class="form-control" id="repeat_password" autocomplete="off"
                                       placeholder="" name="repeat_password">

                            </div>

                            <button type="submit" class="btn btn-primary mr-2">提交</button>

                        </form>

                    {% endif %}
                </div>
            </div>
        </div>
    </div>
{% endblock %}